<#include "../include/header.html">
<#assign title="新增操作人员">
<#if user??>
	<#assign title="编辑操作人员">
</#if>
<div class="container">
    <#include "../include/left.html">
    <div class="content">
		<div class="heading clearfix"> 
			<div class="pull-left">${title!''}</div> 
   		</div> 
   		<br>
		   <form action=""  id="user_form"> 
		    <table class="table"> 
		    	<input type="hidden" id="userId" name="userId" value="${(user.userId)!''}">
		     	<tr>
		     		<td class="tit-right" width=60><em class="red">*</em>账号</td>
		     		<td>
		     				<input class="input" maxlength="30"  type="text" name="account" value="${(user.account)!''}" <#if user??>readonly="readonly"</#if> opt="rq common" info="字母,数字或下划线">	
		     		</td>
		     	</tr>
		     	<tr>
		     		<td class="tit-right"><em class="red">*</em>用户名</td>
		     		<td>
		     			<input class="input" maxlength="30"  type="text" value="${(user.userName)!''}" name="userName"  opt="rq"  info="请输入用户名">	
		     		</td>
		     	</tr>
		     	<#if user??>
		     		<#else>
			     	<tr>
			     		<td class="tit-right"><em class="red">*</em>密码</td>
			     		<td>
			     			<input class="input" maxlength="30" type="password" name="password" opt="rq" info="请输入密码">	
			     		</td>
			     	</tr>
		     	</#if>
		     	<tr>
		     		<td class="tit-right">性别</td>
		     		<td>
		     			<label><input type="radio" name="sex" value="0"checked="checked">男&nbsp;&nbsp;</label>
		     			<label><input type="radio" name="sex" value="1" <#if user??&&user.sex==1>checked="checked"</#if> >女</label>
		     		</td>
		     	</tr>
		     	<tr>
		     		<td class="tit-right">邮箱</td>
		     		<td>
		     			<input class="input" maxlength="30" name="email"  type="text" value="${(user.email)!''}"  opt="email">	
		     		</td>
		     	</tr>
		     	<tr>
		     		<td class="tit-right">手机</td>
		     		<td>
		     				<input class="input" maxlength="30" name="mobilePhone"  type="text" value="${(user.mobilePhone)!''}"  opt="phone">	
		     		</td>
		     	</tr>
	     		<tr> 
		     		<td class="tit-right">备注</td>
		     		<td><textarea rows="5" cols="40"  info="请输入备注"></textarea></td>
   				</tr>
    			<tr> 
		     		<td class="tit-right">角色</td>
		     		<td>
		     			<div class="checkbox-group" opt="rq" info="至少选择一个角色">
			     			<#list roleList as item>
			     				<#assign checked="">
			     				<#if user??>
			     					<#list user.roles as selectRole>
			     						<#if (item.id?c)==selectRole>
			     							 <#assign checked="checked">
			     						</#if>
			     					</#list>
			     				</#if>
			     				<label class="role-label"><input <#if checked??&&checked!="">checked</#if> type="checkbox" name="role" value="${item.id}">&nbsp;${item.roleName}</label>
			     			</#list>
		     			</div>
		     		</td>
    			</tr>
    			<tr> 
		     		<td></td>
		     		<td><a class="btn btn-large" href="javascript:history.back(-1)">返回</a><a href="javascript:void(0)" class="btn btn-color btn-large" id="saveBtn">提交</a> </td>
    			</tr>
		    </table> 
		   </form> 
	</div>
</div>
<style>
<!--
.role-label{margin-top:10px;margin-right: 10px;display: inline-block;}	
-->
</style>
<script type="text/javascript">
seajs.use("settings/user.edit.js");
</script>
<#include "../include/buttom.html">
</body>
</html>